package com.ccp.dev.qbdms.dao;

import com.ccp.dev.core.basic.base.IBaseMapper;
import com.ccp.dev.core.basic.web.query.QueryFilter;
import com.ccp.dev.qbdms.model.WQbdMyCollection;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

/**
 * 我的收藏 信息数据库操作类
 *
 * @author 于金
 * @date 2020-07-27 15:14:51
 */
@Mapper
public interface WQbdMyCollectionDao extends IBaseMapper<WQbdMyCollection,String> {

    List<WQbdMyCollection> queryAll(QueryFilter queryFilter);

    @Select("select * from w_qbd_my_collection where userId=#{userId} and qualityknowledgeId=#{tzId} ")
    WQbdMyCollection queryIsSc(@Param(value ="userId" ) String userId,@Param("tzId") String tzId);

    @Update("update w_qbd_my_collection set status=#{status}, updatetime = #{updateTime,jdbcType=TIMESTAMP}  where userId=#{userId} and qualityknowledgeId=#{tzId} ")
    int updateByUserIdAndTzId(@Param(value ="userId" ) String userId, @Param("tzId") String tzId, @Param("status") String status,@Param("updateTime") Date updateTime);
}
